#ifndef __ALIGNEDFACE_H__
#define __ALIGNEDFACE_H__
#include "detect.h"
#include <opencv2/opencv.hpp>
using namespace cv;
struct Args {
        Mat                image;
        std::vector<float> args;
};

class AlignedFace : public DetectTask<Args> {
    public:
        AlignedFace (std::string id = "alignedFace");
        virtual ~AlignedFace ();
    virtual void Run (const Args &input,Args& output);

    private:
        static std::vector<Point2f> ref5;
        Mat                         computeAffineInverse (const Mat &affine);
        bool estimateAffine2D (const std::vector<cv::Point2f> &srcPoints, const std::vector<cv::Point2f> &dstPoints,
            cv::Mat &affineTransform, std::vector<uchar> &inliers, float reprojectionThreshold = 3.0f,
            int maxIters = 2000, float confidence = 0.995f);
};

#endif
